<template>
  <el-input v-model="input" clearable type="textarea" :rows="22" placeholder="表格配置" />
</template>

<script setup>
import { ref, watch } from 'vue';

const props = defineProps({
  modelValue: {
    type: Object,
    default: ()=>{},
  },
});

const emit = defineEmits(['update:modelValue']);

const input = ref(JSON.stringify(props.modelValue,null,2));

watch(input, (newValue) => {
  // console.log('%c newValue','font-size:24px;color:red;',newValue)
  emit('update:modelValue', JSON.parse(newValue));
});

</script>